package com.aspose.cells.a.f;

import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Enumeration;
import org.apache.tools.zip.ZipEntry;
import org.apache.tools.zip.ZipFile;

abstract class zd extends za {
   protected ZipFile c;

   public InputStream c(String var1) throws Exception {
      int var2 = this.b(var1);
      if (var2 < 0) {
         return null;
      } else {
         if (this.c == null) {
            this.d();
         }

         return this.c.getInputStream(this.c.getEntry(this.a[var2]));
      }
   }

   void e() throws Exception {
      ArrayList var1 = new ArrayList();
      ArrayList var2 = new ArrayList();
      Enumeration var3 = this.c.getEntries();

      while(true) {
         ZipEntry var4;
         do {
            do {
               if (!var3.hasMoreElements()) {
                  this.a = new String[var1.size()];
                  var1.toArray(this.a);
                  this.b = new int[var2.size()];

                  for(int var8 = 0; var8 < this.b.length; ++var8) {
                     this.b[var8] = (Integer)var2.get(var8);
                  }

                  return;
               }

               var4 = (ZipEntry)var3.nextElement();
            } while(var4 == null);
         } while(var4.isDirectory());

         try {
            InputStream var5 = this.c.getInputStream(var4);

            int var6;
            for(var6 = 0; var5.read() > -1; var6 = (int)((long)var6 + var5.skip(1024000L))) {
               ++var6;
            }

            var2.add(var6);
            var1.add(var4.getName());
         } catch (IOException var7) {
            com.aspose.cells.a.e.zf.a("Unable to read data from ZipEntry: " + var4.getName());
         }
      }
   }
}
